#唐门优测
#道长最帅666
from string import Template
import yaml
def yaml_template(data: dict):
    with open(r"D:\daima\xin-daima\kejian\yaml动态替换\test.yaml", encoding="utf-8") as f:
        re = Template(f.read()).substitute(data)
        return yaml.safe_load(re)

if __name__ == '__main__':
    data = {
        "value1":"test1",
        "value2": "hollle2"
    }
    print(yaml_template(data))

